/* var a = 12
var b = a
b = 13
console.log(a) */

let sy = Symbol('AA')
let x = {
    0: 0
}
let obj = {
    0: 12,
    true: 'xx',
    null: 20
}
obj[sy] = 'zf'
obj[x] = 100

for(let key in obj) { 
    // for in 遍历过程中拿到的key值都会变为字符串 
    //  但无法迭代到Symbol类型的
    console.log(key, typeof key)
}


var a = {},
    b = Symbol('1'),
    c = Symbol('1')

    a[b] = '12'
    a[c] = '34'
    console.log(a[b]) // -> '12'


var a = {},
    b = {n: '1'},
    c = {n: '2'}
    a[b] = '12'
    a[c] = '34'
    console.log(a[b]) // -> '34'

// a.x = a = {}
// a = a.x = {}
// 因为成员访问 a.x的优先级是很大的 所以先处理a.x = {}
var a = {a: 1};
var b = a;
a.x = a = {n: 2}
console.log(a.x) // -> undefined
console.log(b) // {n: 1, x: {n: 2}}

let x = {
    name: 'xxx'
}
x.n = x


var x = [12, 23]
function fn(y) {
    y[0] = 100
    y = [100]
    y[1] = 200
    console.log(y)
}

fn(x)
console.log(x)









